home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_oth / libry31a / libry2.doc < prev    next >
Text File  |  1987-01-20  |  8KB  |  240 lines

  1. .pa
  2.                    GENERAL UTILITIES AND CRT CONTROL
  3.  
  4. These general utilities should work on whatever system you have (as long
  5. as  it  is basically IBM compatible or an HP-1000).  However, all of the
  6. CRT control procedures will only work on PCs with a monochrome or  color
  7. graphics  adaptor  (CGA)  or  compatible,  HP-26XX,  or  Tektronix  4XXX
  8. terminals.
  9.  
  10. None of the CRT control procedures will work on a PC in 40 column  mode.
  11. I  did  this  intentionally  because  it  looks  too much like BASIC.  I
  12. couldn't bare the thought of any of my software running  in  BASIC.   In
  13. fact,  I  intentionally  change  the data offset register so as to croak
  14. BASIC.
  15. .pa
  16.             QUICK LIST OF GENERAL UTILITIES AND CRT CONTROL
  17.  
  18. ADATE:  fetch the date
  19. ATIME:  fetch the time of day
  20. BEEP:   beep
  21. CLEAR1: clear one line on the CRT and move cursor to column 1
  22. CPU:    fetch the time (also see SECNDS)
  23. ERASE:  clear the CRT
  24. FFPRN:  send a form-feed to the printer
  25. FTIME:  fetch character string indicating date and time
  26. IFBRK:  detect keyboard interrupt (if-break)
  27. PAUSE:  display message and wait for any keystroke
  28. PRT1C:  send 1 character to the printer
  29. READ1:  read 1 character from the keyboard - don't wait for RETURN
  30. SECNDS: fetch the time (also see CPU)
  31. UP1LIN: move the cursor up 1 line on the CRT
  32. WRPRN:  print a character string
  33. WRTTY:  write a character string on the CRT
  34. READC:  read a string from the keyboard
  35. .pa
  36. NAME:     ADATE
  37. PURPOSE:  fetch the date
  38. TYPE:     subroutine (far external)
  39. SYNTAX:   CALL ADATE(MONTH,IDAY,IYEAR)
  40. INPUT:    none
  41. OUTPUT:   MONTH (INTEGER*2) month
  42.           IDAY (INTEGER*2) day of the month
  43.           IYEAR (INTEGER*2) year 1986, 1987, etc.
  44.  
  45.  
  46. NAME:     ATIME
  47. PURPOSE:  fetch the time of day
  48. TYPE:     subroutine (far external)
  49. SYNTAX:   CALL ATIME(IHOUR,MIN,ISEC,IHUN)
  50. INPUT:    none
  51. OUTPUT:   IHOUR (INTEGER*2) hours in military time
  52.           MIN (INTEGER*2) minutes
  53.           ISEC (INTEGER*2) seconds
  54.           IHUN (INTEGER*2) hundredths of seconds
  55.  
  56.  
  57. NAME:     BEEP
  58. PURPOSE:  beep
  59. TYPE:     subroutine (far external)
  60. SYNTAX:   CALL BEEP
  61. INPUT:    none
  62. OUTPUT:   none
  63.  
  64.  
  65. NAME:     CLEAR1
  66. PURPOSE:  clear one line on the CRT and move cursor to column 1
  67. TYPE:     subroutine (far external)
  68. SYNTAX:   CALL CLEAR1
  69. INPUT:    none
  70. OUTPUT:   none
  71.  
  72.  
  73. NAME:     CPU
  74. PURPOSE:  fetch the time
  75. TYPE:     subroutine (far external)
  76. SYNTAX:   CALL CPU(SEC)
  77. INPUT:    none
  78. OUTPUT:   SEC (REAL*4) seconds
  79. NOTE:     on the PC this returns the elapsed time since midnight
  80.           on the HP-1000F this returns cumulative session CPU
  81.           this is useful for computing runtimes
  82.           also see SECNDS
  83.  
  84.  
  85. NAME:     ERASE
  86. PURPOSE:  clear the CRT
  87. TYPE:     subroutine (far external)
  88. SYNTAX:   CALL ERASE
  89. INPUT:    none
  90. OUTPUT:   none
  91.  
  92.  
  93. NAME:     FFPRN
  94. PURPOSE:  send a form-feed to the printer
  95. TYPE:     subroutine (far external)
  96. SYNTAX:   CALL FFPRN
  97. INPUT:    none
  98. OUTPUT:   none
  99.  
  100.  
  101. NAME:     FTIME
  102. PURPOSE:  fetch character string indicating date and time
  103. TYPE:     subroutine (far external)
  104. SYNTAX:   CALL FTIME(DATE)
  105. INPUT:    none
  106. OUTPUT:   DATE (CHARACTER*30)
  107.  
  108.  
  109. NAME:     IFBRK
  110. PURPOSE:  detect keyboard interrupt (if-break)
  111. TYPE:     LOGICAL*2 function (far external)
  112. SYNTAX:   IF(IFBRK(0)) GO TO 100
  113. INPUT:    none
  114. OUTPUT:   none
  115. NOTE:     you must pass a dummy parameter "0" so FORTRAN will generate
  116.           the proper calling sequence
  117.  
  118.  
  119. NAME:     PAUSE
  120. PURPOSE:  display the message "hit the SPACE BAR to continue" and wait
  121.           for any keystroke
  122. TYPE:     subroutine (far external)
  123. SYNTAX:   CALL PAUSE
  124. INPUT:    none
  125. OUTPUT:   none
  126. NOTE:     you may want to follow this with CALL CLEAR1 to erase the line
  127.  
  128.  
  129. NAME:     PRT1C
  130. PURPOSE:  send 1 character to the printer (bypasses DOS)
  131. TYPE:     subroutine (far external)
  132. SYNTAX:   CALL PRT1C('a') or CALL PRT1C(CHAR(13))
  133. INPUT:    one CHARACTER*1 variable
  134. OUTPUT:   none
  135. NOTE:     if you want to print a string use WRPRN
  136.  
  137.  
  138. NAME:     READ1
  139. PURPOSE:  read 1 character from the keyboard - don't wait for RETURN
  140. TYPE:     subroutine (far external)
  141. SYNTAX:   CALL READ1(ANS)
  142. INPUT:    none
  143. OUTPUT:   ANS (CHARACTER*1)
  144. NOTE:     this is very handy for creating menus - also it is impossible
  145.           to do in FORTRAN (READ1 is in assembler)
  146.  
  147.  
  148. NAME:     SECNDS
  149. PURPOSE:  fetch the time
  150. TYPE:     REAL*4 function (far external)
  151. SYNTAX:   T=SECNDS(0.) or T=SECNDS(T0)
  152. INPUT:    T0 (REAL*4) offset time
  153. OUTPUT:   seconds since midnight (REAL*4)
  154. NOTE:     this is for compatibility with DEC machines
  155.           also see CPU
  156.  
  157.  
  158. NAME:     UP1LIN
  159. PURPOSE:  move the cursor up 1 line on the CRT
  160. TYPE:     subroutine (far external)
  161. SYNTAX:   CALL UP1LIN
  162. INPUT:    none
  163. OUTPUT:   none
  164. NOTE:     there is no way to do this in FORTRAN on the PC
  165.           (UP1LIN is in assembler)
  166.  
  167.  
  168. NAME:     WRPRN
  169. PURPOSE:  print a character string
  170. TYPE:     subroutine (far external)
  171. SYNTAX:   CALL WRPRN('print this string<')
  172. INPUT:    a character string (CHARACTER*? , it doesn't matter)
  173. OUTPUT:   none
  174. NOTE:     this bypasses DOS (which is often advantageous)
  175.  
  176.           CALL WRPRN('this is only a test_')
  177.           CALL WRPRN(' for the next 60 seconds<')
  178.  
  179.           the above 2 lines will print on the same line as...
  180.  
  181.                this is only a test for the next 60 seconds
  182.  
  183.           The "_" tells WRPRN to not follow the string with a
  184.           carriage return (CR) and line feed (LF) while the "<"
  185.           does indicate this. Neither the "_" nor the "<" will
  186.           actually be printed.
  187.  
  188.           If you want to change the symbols "_" and "<" to say
  189.           "+" and "." use the following...
  190.  
  191.           CALL WRPRN('_+.this is only a test+')
  192.           CALL WRPRN('_+.for the next 60 seconds.')
  193.  
  194.           Of course, in this case you can't print a "+" or a "."
  195.           so you could use CHAR(0) and CHAR(13) instead. Beginning
  196.           a string with a "_" tells WRPRN that the next 2 characters
  197.           are to replace the "_" and "<" characters.
  198.  
  199.           Also see WRTTY.
  200.  
  201.           In case you are wondering why I wrote this, it's because some
  202.           misguided persons at DEC and Microsoft had this bizarre idea
  203.           that one should put some stupid character like "\" or "$" at
  204.           the end of a format to suppress a carriage control, while the
  205.           whole rest of the world uses "_" at the end of a string.
  206.           If anyone out there knows, please tell me what comes over
  207.           these people who do weird things like this?
  208.  
  209. WARNING:  should you forget to end the string with a proper terminator
  210.           (e.g. "_" or "<") WRPRN will just continue indefinitely until
  211.           it finds one or your system crashes...
  212.  
  213.  
  214. NAME:     WRTTY
  215. PURPOSE:  write a character string on the CRT
  216. TYPE:     subroutine (far external)
  217. SYNTAX:   CALL WRTTY('display this string<')
  218. INPUT:    a character string (CHARACTER*? , it doesn't matter)
  219. OUTPUT:   none
  220. NOTE:     This bypasses DOS (which is often advantageous) AND the BIOS
  221.           (which is also often advantageous) and pushes your string
  222.           directly into the display memory (as a result Ctrl-PrtSc will
  223.           not even see it).  This is VERY much faster than DOS (which is
  224.           often painfully slow) and the BIOS (which isn't any better).
  225.           On the HP this goes directly to the OPSYS, not the FORTRAN I/O
  226.           handler.
  227.  
  228.           For notes on how to use WRTTY see WRPRN.
  229.  
  230.  
  231. NAME:     READC
  232. PURPOSE:  read a string from the keyboard
  233. TYPE:     subroutine (far external)
  234. SYNTAX:   CALL READC(CBUF,NBUF,IERR)
  235. INPUT:    NBUF (INTEGER*2) maximum number of characters to be read
  236. OUTPUT:   CBUF (CHARACTER*1 CBUF(NBUF) or CHARACTER*80 CBUF, NBUF=80)
  237.           IERR (INTEGER*2) error return indicator (IERR=0 is normal)
  238. NOTE:     This bypasses DOS (which is often advantageous). On the HP
  239.           this goes directly to the OPSYS.
  240.